/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package easyanimation.frame;

import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
import javax.swing.border.BevelBorder;
import javax.swing.border.EtchedBorder;

/**
 *
 * @author tandn
 */
public final class Constant
{
    //Cursor constants
    public static final int CURSOR_NORMAL = 0;
    public static final int CURSOR_UP = CURSOR_NORMAL + 1;
    public static final int CURSOR_DOWN = CURSOR_UP + 1;
    public static final int CURSOR_LEFT = CURSOR_DOWN + 1;
    public static final int CURSOR_RIGHT = CURSOR_LEFT + 1;
    public static final int CURSOR_CENTER = CURSOR_RIGHT + 1;
    public static final int CURSOR_CROSS_UP_LEFT = CURSOR_CENTER + 1;
    public static final int CURSOR_CROSS_UP_RIGHT = CURSOR_CROSS_UP_LEFT + 1;
    public static final int CURSOR_CROSS_DOWN_LEFT = CURSOR_CROSS_UP_RIGHT + 1;
    public static final int CURSOR_CROSS_DOWN_RIGHT = CURSOR_CROSS_DOWN_LEFT + 1;
    //Constant size of window
    public static final int WINDOW_WIDTH = 1024;
    public static final int WINDOW_HEIGHT = 640;
    public static final int WINDOW_HEIGHT_HEADER = 100;
    public static final int WINDOW_WIDTH_LEFT = 256;
    public static final int WINDOW_WIDTH_RIGHT = 100;
    public static final int WINDOW_WIDTH_BOTTOM = 100;
    public static final int WINDOW_HEIGHT_LEFT_LIST_ITEM = WINDOW_HEIGHT - WINDOW_HEIGHT_HEADER >> 1;
   
    //Standard Border
    public static final EtchedBorder OBJ_BORDER_COMMON = new EtchedBorder(Color.LIGHT_GRAY, Color.GRAY);
    public static final BevelBorder OBJ_BORDER_TOOBAR = new BevelBorder(BevelBorder.RAISED);
    //Margin components
    public static final Font OBJ_FONT_BOLD = new Font("Tahoma", Font.BOLD, 11);
    public static final Font OBJ_FONT_PLAIN = new Font("Tahoma", Font.PLAIN, 11);
    public static final Font OBJ_FONT_ITALIC = new Font("Tahoma", Font.ITALIC, 11);
    public static final Insets OBJ_MARGIN = new Insets(0, 0, 0, 0);
    public static final int COMPONENT_SMALL_HEIGHT = 20;
    public static final int CHARACTOR_WIDTH = 10;
    //The info indexs of the sub table(of the frame, the animation)
    public static final int MODULE_INFO_X = 0;
    public static final int MODULE_INFO_Y = MODULE_INFO_X + 1;
    public static final int MODULE_INFO_W = MODULE_INFO_Y + 1;
    public static final int MODULE_INFO_H = MODULE_INFO_W + 1;
    public static final int TOTAL_MODULE_INFOS = MODULE_INFO_H + 1;
    //left
    public static final int IMAGE_FIELD_WIDTH = 19;
    public static final String[] FILE_TYPES_SUPPORTED =
    {
        "jpg", "png"
    };
    //status
    public static final int STATUS_FIELD_WIDTH = 8;
    //Zoom image
    public static final int ZOOM_MAX = 1000;//%
    public static final int ZOOM_MIN = 10;//%
    public static final int ZOOM_NORMAL = 100;//%
    public static final int ZOOM_STEP = 2;// 1%
    //Cursor distance
    public static final int CURSOR_DISTANCE_IN = 2;
    public static final int CURSOR_DISTANCE_OUT = 7;
    //Actions of table
    public static final int TABLE_ACTION_NONE = -1; //nothing
    public static final int TABLE_ACTION_ADD = TABLE_ACTION_NONE + 1;//add a row
    public static final int TABLE_ACTION_ADD_OUTSIDE = TABLE_ACTION_ADD + 1;//add a row from outside the table
    public static final int TABLE_ACTION_INSERT = TABLE_ACTION_ADD_OUTSIDE + 1;//insert a row
    public static final int TABLE_ACTION_DELETE = TABLE_ACTION_INSERT + 1;//delete a row
    public static final int TABLE_ACTION_UPDATE = TABLE_ACTION_DELETE + 1;//modified a row
    public static final int TABLE_ACTION_UPDATE_INDEX = TABLE_ACTION_UPDATE + 1;//modified a row only index from outside the table
    public static final int TABLE_ACTION_UPDATE_NOT_INDEX = TABLE_ACTION_UPDATE_INDEX + 1;//modified a row not index from outside the table
    public static final int TABLE_ACTION_SELECT = TABLE_ACTION_UPDATE_NOT_INDEX + 1;//select a row
    //Left constants
    public static final String[][] COLUMN_NAMES =
    {
        {//Palette
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], Language.COLUMN_TABLE_NAME[CConfig.LANGUAGE]
        },
        {//Module
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], "x", "y", "w", "h"
        },
        {//Frame
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], "x", "y", Language.COLUMN_TABLE_NAME[CConfig.LANGUAGE]
        },
        {//Animation
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], "x", "y", Language.COLUMN_TABLE_NAME[CConfig.LANGUAGE]
        },
        {//sub-table module
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], Language.MODULE[CConfig.LANGUAGE], "x", "y"
        },
        {//sub-table frame
            Language.COLUMN_TABLE_INDEX[CConfig.LANGUAGE], Language.FRAME[CConfig.LANGUAGE], "x", "y", Language.COLUMN_TABLE_LOOP[CConfig.LANGUAGE]
        }
    };
    public static final int COLUMN_WIDTH = 55;
    public static final int DATA_MODULE_DEFAULT_WIDTH = 30;
    public static final int DATA_MODULE_DEFAULT_HEIGHT = 30;
    public static final int DATA_FRAME_LOOP = 1;
    public static final Object[] DATA_PALETTE =
    {//Palette
        0, ""
    };
    public static final Object[] DATA_MODULE =
    {//Module
        0, "0", "0", "" + DATA_MODULE_DEFAULT_WIDTH, "" + DATA_MODULE_DEFAULT_HEIGHT
    };
    public static final Object[] DATA_FRAME =
    {//Frame
        0, "0", "0", ""
    };
    public static final Object[] DATA_ANIMATION =
    {//Animation
        0, "0", "0", ""
    };
    public static final Object[] DATA_SUB_TABLE =
    {//SUB table
        0, "0", "0", "0", DATA_FRAME_LOOP + ""
    };
    /****************************   TAB ************************************************/
    //index tab
    public static final int TAB_INDEX_PALETTE = 0;
    public static final int TAB_INDEX_MODULE = TAB_INDEX_PALETTE + 1;
    public static final int TAB_INDEX_FRAME = TAB_INDEX_MODULE + 1;
    public static final int TAB_INDEX_ANIMATION = TAB_INDEX_FRAME + 1;
    public static final int TOTAL_TABS = TAB_INDEX_ANIMATION + 1;
    //
    public static final int SUB_TABLE_MODULE = TOTAL_TABS;
    public static final int SUB_TABLE_FRAME = TOTAL_TABS + 1;
    //Palette
    public static final int COLUMN_TAB_PALETTE_INDEX = 0;
    public static final int COLUMN_TAB_PALETTE_NAME = COLUMN_TAB_PALETTE_INDEX + 1;
    public static final int TOTAL_COLUMN_TABS_PALETTE = COLUMN_TAB_PALETTE_NAME + 1;
    public static final int[] COLUMN_TAB_PALETTE_NON_EDITABLE =
    {
        COLUMN_TAB_PALETTE_INDEX
    };
    public static final int[] COLUMN_TAB_PALETTE_INTEGER = null;
    public static final int[] COLUMN_TAB_PALETTE_INTEGER_POSITIVE = null;
    //Module
    public static final int COLUMN_TAB_MODULE_INDEX = 0;
    public static final int COLUMN_TAB_MODULE_X = COLUMN_TAB_MODULE_INDEX + 1;
    public static final int COLUMN_TAB_MODULE_Y = COLUMN_TAB_MODULE_X + 1;
    public static final int COLUMN_TAB_MODULE_W = COLUMN_TAB_MODULE_Y + 1;
    public static final int COLUMN_TAB_MODULE_H = COLUMN_TAB_MODULE_W + 1;
    public static final int TOTAL_COLUMN_TABS_MODULE = COLUMN_TAB_MODULE_H + 1;
    public static final int[] COLUMN_TAB_MODULE_NON_EDITABLE =
    {
        COLUMN_TAB_MODULE_INDEX
    };
    public static final int[] COLUMN_TAB_MODULE_INTEGER =
    {
        COLUMN_TAB_MODULE_X,
        COLUMN_TAB_MODULE_Y,
        COLUMN_TAB_MODULE_W,
        COLUMN_TAB_MODULE_H
    };
    public static final int[] COLUMN_TAB_MODULE_INTEGER_POSITIVE =
    {
        COLUMN_TAB_MODULE_X,
        COLUMN_TAB_MODULE_Y,
        COLUMN_TAB_MODULE_W,
        COLUMN_TAB_MODULE_H
    };
    //Frame
    public static final int COLUMN_TAB_FRAME_INDEX = 0;
    public static final int COLUMN_TAB_FRAME_X = COLUMN_TAB_FRAME_INDEX + 1;
    public static final int COLUMN_TAB_FRAME_Y = COLUMN_TAB_FRAME_X + 1;
    public static final int COLUMN_TAB_FRAME_NAME = COLUMN_TAB_FRAME_Y + 1;
    public static final int TOTAL_COLUMN_TABS_FRAME = COLUMN_TAB_FRAME_NAME + 1;
    public static final int[] COLUMN_TAB_FRAME_NON_EDITABLE =
    {
        COLUMN_TAB_FRAME_INDEX
    };
    public static final int[] COLUMN_TAB_FRAME_INTEGER =
    {
        COLUMN_TAB_FRAME_X,
        COLUMN_TAB_FRAME_Y
    };
    public static final int[] COLUMN_TAB_FRAME_INTEGER_POSITIVE = null;
    //Animation
    public static final int COLUMN_TAB_ANIMATION_INDEX = 0;
    public static final int COLUMN_TAB_ANIMATION_X = COLUMN_TAB_ANIMATION_INDEX + 1;
    public static final int COLUMN_TAB_ANIMATION_Y = COLUMN_TAB_ANIMATION_X + 1;
    public static final int COLUMN_TAB_ANIMATION_NAME = COLUMN_TAB_ANIMATION_Y + 1;
    public static final int TOTAL_COLUMN_TABS_ANIMATION = COLUMN_TAB_ANIMATION_NAME + 1;
    public static final int[] COLUMN_TAB_ANIMATION_NON_EDITABLE =
    {
        COLUMN_TAB_ANIMATION_INDEX
    };
    public static final int[] COLUMN_TAB_ANIMATION_INTEGER =
    {
        COLUMN_TAB_ANIMATION_X,
        COLUMN_TAB_ANIMATION_Y
    };
    public static final int[] COLUMN_TAB_ANIMATION_INTEGER_POSITIVE = null;
    //SUB table
    public static final int COLUMN_SUB_TABLE_INDEX = 0;
    public static final int COLUMN_SUB_TABLE_ITEM_INDEX = COLUMN_SUB_TABLE_INDEX + 1;
    public static final int COLUMN_SUB_TABLE_X = COLUMN_SUB_TABLE_ITEM_INDEX + 1;
    public static final int COLUMN_SUB_TABLE_Y = COLUMN_SUB_TABLE_X + 1;
    public static final int COLUMN_SUB_TABLE_LOOP = COLUMN_SUB_TABLE_Y + 1;
    
    public static final int[] COLUMN_SUB_TABLE_NON_EDITABLE =
    {
        COLUMN_SUB_TABLE_INDEX
    };
    public static final int[] COLUMN_SUB_TABLE_INTEGER =
    {
        COLUMN_SUB_TABLE_ITEM_INDEX,
        COLUMN_SUB_TABLE_X,
        COLUMN_SUB_TABLE_Y,
        COLUMN_SUB_TABLE_LOOP
    };
    public static final int[] COLUMN_SUB_TABLE_INTEGER_POSITIVE =
    {
        COLUMN_SUB_TABLE_ITEM_INDEX,
        COLUMN_SUB_TABLE_LOOP
    };
    //Buttons toolbar
    public static final int TOOLBAR_BUTTON_NEW_FILE = 0;
    public static final int TOOLBAR_BUTTON_SAVE = TOOLBAR_BUTTON_NEW_FILE + 1;
    public static final int TOOLBAR_BUTTON_BACK = TOOLBAR_BUTTON_SAVE + 1;
    public static final int TOOLBAR_BUTTON_CUT = TOOLBAR_BUTTON_BACK + 1;
    public static final int TOOLBAR_BUTTON_REDO = TOOLBAR_BUTTON_CUT + 1;
    public static final int TOOLBAR_BUTTON_UNDO = TOOLBAR_BUTTON_REDO + 1;
    public static final int TOOLBAR_BUTTON_ZOOM_IN = TOOLBAR_BUTTON_UNDO + 1;
    public static final int TOOLBAR_BUTTON_ZOOM_OUT = TOOLBAR_BUTTON_ZOOM_IN + 1;
}

